import { IToolTip } from "../../../../../../com/mui/manager/IToolTip";
import { TCrossDefenseUpgrade } from "../../../../../../Message/Db/Tables/TCrossDefenseUpgrade";
import { BossConfig } from "../../../../resource/BossConfig";
import { Language } from "../../../../../../extend/language/Language";
import { Cache } from "../../../../cache/Cache";
import { ObjCreate } from "../../../common/ObjCreate";
import { AutoLayoutTextContainer } from "../../../../../common/text/AutoLayoutTextContainer";
import { ScaleBitmap } from "../../../../../../com/mui/display/ScaleBitmap";
import { GTextFiled } from "../../../../../../com/mui/controls/GTextFiled";
type int = number;
//class CrossDefenceBuildMenuItemTips
    
    export  class CrossDefenceBuildMenuItemTips /* flash.display.Sprite */ implements IToolTip
    {
        constructor()
        {
            
            this.initView();
            return;
        }

        public set data(arg1)
        {
            var loc1=arg1 as TCrossDefenseUpgrade;
            if (loc1 == null) 
            {
                return;
            }
            var loc2=BossConfig.instance.getInfoByName(loc1.preBoss);
            if (loc2 != null) 
            {
                this._container.setText(2, Language.getStringByParam(80308, loc2.attackDistance));
                this._container.setText(0, loc2.name + "    Lv" + loc1.level.toString());
            }
            this._container.setText(1, Language.getStringByParam(80306, loc1.desc));
            this._container.setText(3, Language.getStringByParam(80307, loc1.material));
            if (loc1.material > Cache.instance.crossDefenceCopy.myMaterial) 
            {
                this._container.setText(4, Language.getString(80310));
            }
            else 
            {
                this._container.setText(4, Language.getString(80309));
            }
            this._container.resetPosition2();
            this._bg.height = this._container.height + 20;
            return;
        }

        /* internal  */initView(): void
        {
            this._bg = ObjCreate.createBg(0, 0, this.MyWidth, 195, this);
            this._container = new AutoLayoutTextContainer();
            this._container.x = 6;
            this._container.y = 6;
            this._container.verticalGap = 6;
            this.addChild(this._container);
            this._container.addNewText(220, "", 15, 16776960, flash.text.TextFieldAutoSize.LEFT, 3, null, true);
            this._container.addNewText(this.MyWidth - 20);
            this._container.addNewText(this.MyWidth - 20);
            this._container.addNewText(this.MyWidth - 20);
            this._container.addNewText(this.MyWidth - 20, "", 14, 16776960, flash.text.TextFieldAutoSize.LEFT, 3, null, true);
            this._container.addNewText(this.MyWidth - 20, Language.getString(80311));
            return;
        }

        /* internal */ /* const */MyWidth: int=260;

        /* internal */ /* var */_container: AutoLayoutTextContainer;

        /* internal */ /* var */_bg: ScaleBitmap;

        /* internal */ /* var */_txtName: GTextFiled;

        /* internal */ /* var */_txtLevel: GTextFiled;

        /* internal */ /* var */_txtEffect: GTextFiled;

        /* internal */ /* var */_txtRound: GTextFiled;

        /* internal */ /* var */_txtNeedMaterial: GTextFiled;

        /* internal */ /* var */_txtCanBuild: GTextFiled;
    }
